One generation passes away, and another generation comes;
But the earth abides forever. - Ecclesiastes 1:4 New King James Version
Off topic but...
That verse from Ecclesiastes is one of my favorite Bible verses. It is also the Bible verse that the title of the book Earth Abides is inspired by. Earth Abides is an apocalyptic fiction book that shows how nature and humans living in nature can reconquer the earth after 99.99% of humanity dies. No blood and guts like modern sci-fis, just a peaceful transition to a state of nature. It is one of my favorite books.
As for the Earth getting vaporized 5 billion years from now, it will first undergo runaway greenhouse effect by a warming sun in just 1 billion years. The sun gets warmer throughout its lifespan.
As for the contradiction between those Bible verses and science, it would be stated by an apologist of the Bible that God will prevent that fate from happening in a perfect universe.